package caras;
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;

public class CreateSlider{
  JSlider slider;
  JLabel label;
  public static void main(String[] args){
    CreateSlider cs = new CreateSlider();
  }

  public CreateSlider(){
    JFrame frame = new JFrame("Slider Frame");
	 slider = new JSlider();
	
    label = new JLabel("Roseindia.net");
    JPanel panel = new JPanel();
    frame.add(slider);
    panel.add(label);
    frame.add(panel, null);
    frame.setSize(400, 400);
    frame.setVisible(true);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  }

  public class MyChangeAction implements ChangeListener{
    public void stateChanged(ChangeEvent ce){
      int value = slider.getValue();
      String str = Integer.toString(value);
      label.setText(str);
    }
  }
}